﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.Core.Specification;
using Domain.MainModule.Entities;

namespace Domain.MainModule.CustomersMTS
{

    public class CustomerMTSUserIdSpecification: Specification<CustomerMTS>
    {
        /// <summary>
        /// Filtros a definir mas tarde.
        /// </summary>

        Guid _userId;

        public CustomerMTSUserIdSpecification(Guid userId)
        {
            this._userId = userId;
        }

        public override System.Linq.Expressions.Expression<Func<CustomerMTS, bool>> SatisfiedBy()
        {
            Specification<CustomerMTS> spec = new TrueSpecification<CustomerMTS>();

            spec &= new DirectSpecification<CustomerMTS>(t => t.IsEnabled);
            
            spec &= new DirectSpecification<CustomerMTS>(t => t.UserId == this._userId);

            return spec.SatisfiedBy();

        }
    }
}
